package cn.lqz.bucttrain.enums;

/**
 * 站点状态枚举
 */
public enum StationStatusEnum {
    DISABLE(0,"禁用"),
    ENABLE(1,"启用"),
    FIX(2,"维修"),
    STOP(3,"挂停");// 站点处于挂停状态：允许已经出发的列车经停，但不再接收新的线路选择该站点
    private Integer status;
    private String description;

    StationStatusEnum(Integer status, String description){
        this.status = status;
        this.description = description;
    }

    public static StationStatusEnum getByStatus(Integer status){
        for (StationStatusEnum value : StationStatusEnum.values()) {
            if (value.status.equals(status)){
                return value;
            }
        }
        return null;
    }

    public Integer getStatus() {
        return status;
    }
    public String getDescription(){
        return description;
    }
}
